/////////////////////////////////////////////////////////////////////////////
// Name:        ax_textinputdialog.h
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     01/04/2009 14:48:08
// RCS-ID:      
// Copyright:   
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_TEXTINPUTDIALOG_H_
#define _AX_TEXTINPUTDIALOG_H_

class AxSpeech;

/*
 * Includes
 */

////@begin includes
#include "wx/valgen.h"
////@end includes

/*
 * Forward declarations
 */

////@begin forward declarations
class AxTextCtrl;
////@end forward declarations

class wxShortcutManager;

// Pass to give it a multiline text control
#define axTEXTDIALOG_MULTILINE 0x02

/*
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_AXTEXTINPUTDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
#define SYMBOL_AXTEXTINPUTDIALOG_TITLE _("Text Input")
#define SYMBOL_AXTEXTINPUTDIALOG_IDNAME wxID_ANY
#define SYMBOL_AXTEXTINPUTDIALOG_SIZE wxSize(400, 300)
#define SYMBOL_AXTEXTINPUTDIALOG_POSITION wxDefaultPosition
////@end control identifiers

/**
    @class AxTextInputDialog
    
    A class for getting textual input from the user.

    @category{ax}
 */

class AxTextInputDialog: public wxDialog
{    
    DECLARE_DYNAMIC_CLASS( AxTextInputDialog )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    AxTextInputDialog();
    AxTextInputDialog( wxWindow* parent,
        const wxString& message, const wxString& caption, const wxString& defaultValue,
        const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = SYMBOL_AXTEXTINPUTDIALOG_STYLE );

    /// Creation
    bool Create( wxWindow* parent,
        const wxString& message, const wxString& caption, const wxString& defaultValue,
        const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = SYMBOL_AXTEXTINPUTDIALOG_STYLE );

    /// Destructor
    ~AxTextInputDialog();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls(const wxString& defaultValue, const wxString& message);
    
    wxString GetValue() const { return m_value; }
    void SetValue(const wxString& value) { m_value = value; }
    
    wxString GetDescription() const { return m_description; }
    void SetDescription(const wxString& descr) { m_description = descr; }

    void SetSpeech(AxSpeech* speech);
    AxSpeech* GetSpeech() const { return m_speech; }

    void SetShortcutManager(wxShortcutManager* shortcuts);

    void SpeakCurrentText(bool initialView = false);

////@begin AxTextInputDialog event handler declarations

    /// wxEVT_INIT_DIALOG event handler for wxID_ANY
    void OnInitDialog( wxInitDialogEvent& event );

    /// wxEVT_COMMAND_TEXT_UPDATED event handler for wxID_ANY
    void OnAnyTextUpdated( wxCommandEvent& event );

    /// wxEVT_CHAR event handler for wxID_ANY
    void OnChar( wxKeyEvent& event );

////@end AxTextInputDialog event handler declarations

////@begin AxTextInputDialog member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end AxTextInputDialog member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin AxTextInputDialog member variables
    wxStaticText* m_descriptionCtrl;
    AxTextCtrl* m_valueCtrl;
////@end AxTextInputDialog member variables

    wxString    m_value;
    wxString    m_description;

    AxSpeech*   m_speech;
    bool        m_disableEvents;
};

#endif
    // _AX_TEXTINPUTDIALOG_H_
